package com.optimize02;

import com.optimize02.faactory.StrategyFactory;
import com.optimize02.service.impl.ConcreteStrategyA;
import com.optimize02.service.impl.ConcreteStrategyB;

import java.util.HashMap;

/**
 * @author GuoJH
 * @date 2022/8/11 10:57
 * @remark
 */
public class StrategyMain {

    public static void main(String[] args) {
        StrategyFactory factory = new StrategyFactory();
        factory.put("A", new ConcreteStrategyA());
        factory.strategyMethod("A");
        factory.put("B", new ConcreteStrategyB());
        factory.strategyMethod("B");
    }
}
